package com.ity.teamanagement.code;

import lombok.Getter;

/**
 * @author coderFu
 * @create 2021/5/23
 */
@Getter
public enum CommonCode implements Code{

    SUCCESS(true,200,"操作成功"),
    UPDATE_SUCCESS(true,200,"修改成功"),
    DELETE_SUCCESS(true,200,"删除成功"),
    DELETE_ERROR(false,505,"删除失败"),
    PARAMETER_ERROR(false,400,"参数非法"),
    TOKEN_ERROR(false,404,"无效授权"),
    DATA_ERROR(false,500,"数据异常");




    private boolean success;

    private Integer code;

    private String message;

    CommonCode(boolean success, Integer code, String message){
        this.success = success;
        this.code = code;
        this.message = message;
    }


    @Override
    public boolean success() {
        return this.success=success;
    }

    @Override
    public int code() {
        return this.code = code;
    }

    @Override
    public String message() {
        return this.message = message;
    }
}
